<template>
  <div class="home">

    <div class="navheaders">
      <van-nav-bar @click-left="back" @click-right="Resume">
        <template #left>
          <van-icon v-if="isshow" name="arrow-left" color="#fff" size="0.6rem" />
        </template>
        <template #title>
          <span>
            <img src="../../assets/img/logo.png" />
          </span>
        </template>
        <template #right>
          <van-icon name="wap-nav" color="#fff" size="0.6rem" />
        </template>
      </van-nav-bar>
    </div>
    <div class="homenvmy" v-show="homnvshow">
      <van-row>
        <van-col span="6" @click="Myresume('Myresume')">
          <img src="../../assets/img/wdjl.png" />

          <p>我的简历</p>
        </van-col>
        <van-col span="6" @click="Myresume('Deliveryrecord')">
          <img src="../../assets/img/tdjlt.png" />
          <p>投递记录</p>
        </van-col>
        <van-col span="6" @click="Myresume('Mycollection')">
          <img src="../../assets/img/wdsc.png" />
          <p>我的收藏</p>
        </van-col>
        <van-col span="6" @click="Myresume('jobfair')">
          <img src="../../assets/img/wdsc.png" />
          <p>招聘会</p>
        </van-col>
        <div class="pantdelmy">
          <img class="homedelmy" src="../../assets/img/del.png" @click="del" />
        </div>
      </van-row>
    </div>
    <!-- <van-overlay :show="show" /> -->
    <div class="overlay" v-show="show"></div>
    <div>
      <router-view></router-view>
    </div>
    <div class="tabbar">
      <van-row>
        <van-col span="6" @click="Myresume('homepage')">
          <img src="../../assets/img/home.png" />

          <p class="tabbartitle">首页</p>
        </van-col>
        <van-col span="6" @click="Myresume('PositionList')">
          <img src="../../assets/img/zhiwei.png" />
          <p class="tabbartitle">职位</p>
        </van-col>
        <van-col span="6" @click="Myresume('jobfair')">
          <img src="../../assets/img/zhaopinhui.png" />
          <p class="tabbartitle">招聘会</p>
        </van-col>
        <van-col span="6" @click="Myresume('Mydocuments')">
          <img src="../../assets/img/my.png" />
          <p class="tabbartitle">我的</p>
        </van-col>
      </van-row>
    </div>
  </div>
</template>
<script>
import LOGIN from '@/api/login'
export default {
  data () {
    return {
      zw: '',
      pathpage: 'homepage',
      isshow: false,
      show: false,
      homnvshow: false,
      code: "",
      codere: null,
      list: ''
    }
  },
  computed: {},
  methods: {
    back () {
      if (!this.isshow) {
        return false
      }
      this.$router.go(-1) // 返回上一层
    },
    Resume () {
      this.homnvshow = true
      this.show = true
    },

    del () {
      this.homnvshow = false
      this.show = false
    },
    // 我的简历
    Myresume (name) {
      let sessionid
      if (name === 'homepage') {
        sessionid = localStorage.getItem('session_id')
      } else {
        sessionid = ''
      }
      this.$router.push({
        name: name,
        query: {
          session_id: sessionid
        }
      })
      this.del()
    }

  },
  created () {



    // this.$router.push({
    //   name: "homepage"
    // });
  },
  watch: {
    $route (to, from) {
      if (to.path === '/homepage') {
        this.isshow = false
      } else {
        this.isshow = true
      }
      // this.$dialog.close()
    }
  }
}
</script>
<style scoped>
.tabbar {
  position: fixed;
  bottom: 0;
  width: 100%;
  background: #fff;
  border-top: 1px solid #e8e8e8;
  padding-bottom: 10px;
}
.tabbar img {
  width: 36px;
  height: 36px;
}
.tabbar .tabbartitle {
  font-size: 18px;
  font-weight: bold;
  /* color: rgba(24, 147, 252, 1); */
}
</style>
